<!DOCTYPE html>

















































<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <meta name="description" content="Javadoc API documentation for Fresco." />

<link rel="shortcut icon" type="image/x-icon" href="../../../favicon.ico" />
<title>

  AbstractDataSource - Fresco API


| Fresco

</title>
<link href="../../../../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../assets/customizations.css" rel="stylesheet" type="text/css" />
<script src="../../../../assets/search_autocomplete.js" type="text/javascript"></script>
<script src="../../../../assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="../../../../assets/doclava-developer-docs.js" type="text/javascript"></script>
<script src="../../../../assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
  setToRoot("../../../", "../../../../assets/");
</script>
<script src="../../../../assets/doclava-developer-reference.js" type="text/javascript"></script>
<script src="../../../../assets/navtree_data.js" type="text/javascript"></script>
<script src="../../../../assets/customizations.js" type="text/javascript"></script>
<noscript>
  <style type="text/css">
    html,body{overflow:auto;}
    #body-content{position:relative; top:0;}
    #doc-content{overflow:visible;border-left:3px solid #666;}
    #side-nav{padding:0;}
    #side-nav .toggle-list ul {display:block;}
    #resize-packages-nav{border-bottom:3px solid #666;}
  </style>
</noscript>
</head>

<body class="">

<div id="header">
    <div id="headerLeft">
    
      <span id="masthead-title">Fresco</span>
    
    </div>
    <div id="headerRight">
      
  <div id="search" >
      <div id="searchForm">
          <form accept-charset="utf-8" class="gsc-search-box" 
                onsubmit="return submit_search()">
            <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
                <tr>
                  <td class="gsc-input">
                    <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
                      title="search developer docs" name="q"
                      value="search developer docs"
                      onFocus="search_focus_changed(this, true)"
                      onBlur="search_focus_changed(this, false)"
                      onkeydown="return search_changed(event, true, '../../../')"
                      onkeyup="return search_changed(event, false, '../../../')" />
                  <div id="search_filtered_div" class="no-display">
                      <table id="search_filtered" cellspacing=0>
                      </table>
                  </div>
                  </td>
                  <td class="gsc-search-button">
                    <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
                  </td>
                  <td class="gsc-clear-button">
                    <div title="clear results" class="gsc-clear-button">&nbsp;</div>
                  </td>
                </tr></tbody>
              </table>
          </form>
      </div><!-- searchForm -->
  </div><!-- search -->
      
    </div>
</div><!-- header -->


  <div class="g-section g-tpl-240" id="body-content">
    <div class="g-unit g-first side-nav-resizable" id="side-nav">
      <div id="swapper">
        <div id="nav-panels">
          <div id="resize-packages-nav">
            <div id="packages-nav">
              <div id="index-links">
                <a href="../../../packages.html"  >Package Index</a> | 
                <a href="../../../classes.html" >Class Index</a>
              </div>
              <ul>
                
    <li class="api apilevel-">
  <a href="../../../com/facebook/binaryresource/package-summary.html">com.facebook.binaryresource</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/cache/common/package-summary.html">com.facebook.cache.common</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/cache/disk/package-summary.html">com.facebook.cache.disk</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/common/disk/package-summary.html">com.facebook.common.disk</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/common/internal/package-summary.html">com.facebook.common.internal</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/common/logging/package-summary.html">com.facebook.common.logging</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/common/memory/package-summary.html">com.facebook.common.memory</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/common/references/package-summary.html">com.facebook.common.references</a></li>
    <li class="selected api apilevel-">
  <a href="../../../com/facebook/datasource/package-summary.html">com.facebook.datasource</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/backends/pipeline/package-summary.html">com.facebook.drawee.backends.pipeline</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/backends/volley/package-summary.html">com.facebook.drawee.backends.volley</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/controller/package-summary.html">com.facebook.drawee.controller</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/drawable/package-summary.html">com.facebook.drawee.drawable</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/generic/package-summary.html">com.facebook.drawee.generic</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/interfaces/package-summary.html">com.facebook.drawee.interfaces</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/drawee/view/package-summary.html">com.facebook.drawee.view</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/animated/base/package-summary.html">com.facebook.imagepipeline.animated.base</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/animated/factory/package-summary.html">com.facebook.imagepipeline.animated.factory</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/animated/impl/package-summary.html">com.facebook.imagepipeline.animated.impl</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/animated/util/package-summary.html">com.facebook.imagepipeline.animated.util</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/backends/okhttp3/package-summary.html">com.facebook.imagepipeline.backends.okhttp3</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/bitmaps/package-summary.html">com.facebook.imagepipeline.bitmaps</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/cache/package-summary.html">com.facebook.imagepipeline.cache</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/common/package-summary.html">com.facebook.imagepipeline.common</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/core/package-summary.html">com.facebook.imagepipeline.core</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/datasource/package-summary.html">com.facebook.imagepipeline.datasource</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/decoder/package-summary.html">com.facebook.imagepipeline.decoder</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/image/package-summary.html">com.facebook.imagepipeline.image</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/listener/package-summary.html">com.facebook.imagepipeline.listener</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/memory/package-summary.html">com.facebook.imagepipeline.memory</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/producers/package-summary.html">com.facebook.imagepipeline.producers</a></li>
    <li class="api apilevel-">
  <a href="../../../com/facebook/imagepipeline/request/package-summary.html">com.facebook.imagepipeline.request</a></li>
              </ul><br/>
            </div> <!-- end packages -->
          </div> <!-- end resize-packages -->
          <div id="classes-nav">
            <ul>
              
    <li><h2>Interfaces</h2>
      <ul>
          <li class="api apilevel-"><a href="../../../com/facebook/datasource/DataSource.html">DataSource</a>&lt;T&gt;</li>
          <li class="api apilevel-"><a href="../../../com/facebook/datasource/DataSubscriber.html">DataSubscriber</a>&lt;T&gt;</li>
      </ul>
    </li>
              
    <li><h2>Classes</h2>
      <ul>
          <li class="selected api apilevel-"><a href="../../../com/facebook/datasource/AbstractDataSource.html">AbstractDataSource</a>&lt;T&gt;</li>
          <li class="api apilevel-"><a href="../../../com/facebook/datasource/BaseDataSubscriber.html">BaseDataSubscriber</a>&lt;T&gt;</li>
          <li class="api apilevel-"><a href="../../../com/facebook/datasource/DataSources.html">DataSources</a></li>
      </ul>
    </li>
              
              
              
              
            </ul><br/>
          </div><!-- end classes -->
        </div><!-- end nav-panels -->
        <div id="nav-tree" style="display:none">
          <div id="index-links">
            <a href="../../../packages.html"  >Package Index</a> | 
            <a href="../../../classes.html" >Class Index</a>
          </div>
        </div><!-- end nav-tree -->
      </div><!-- end swapper -->
    </div> <!-- end side-nav -->
    <script>
      if (!isMobile) {
        $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
        chooseDefaultNav();
        if ($("#nav-tree").is(':visible')) {
          init_default_navtree("../../../");
        } else {
          addLoadEvent(function() {
            scrollIntoView("packages-nav");
            scrollIntoView("classes-nav");
          });
        }
        $("#swapper").css({borderBottom:"2px solid #aaa"});
      } else {
        swapNav(); // tree view should be used on mobile
      }
    </script>



<div class="g-unit" id="doc-content">

<div id="api-info-block">



  
   
  
  
  
  

  
   
  
  
  
  


<div class="sum-details-links">


Summary:










  <a href="#proctors">Protected Ctors</a>
  


  &#124; <a href="#pubmethods">Methods</a>
  


  &#124; <a href="#promethods">Protected Methods</a>
  


  &#124; <a href="#inhmethods">Inherited Methods</a>

&#124; <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>

</div><!-- end sum-details-links -->
<div class="api-level">
  


  
  

</div>
</div><!-- end api-info-block -->


<!-- ======== START OF CLASS DATA ======== -->

<div id="jd-header">
    public
     
     
    abstract
    class
<h1>AbstractDataSource</h1>



  
    extends Object<br/>
  
  
  

  
  
      implements 
      
        <a href="../../../com/facebook/datasource/DataSource.html">DataSource</a>&lt;T&gt; 
      
  
  


</div><!-- end header -->

<div id="naMessage"></div>

<div id="jd-content" class="api apilevel-">
<table class="jd-inheritance-table">


    <tr>
         	
        <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object</td>
    </tr>
    

    <tr>
        
            <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;&#x21b3;</td>
         	
        <td colspan="1" class="jd-inheritance-class-cell">com.facebook.datasource.AbstractDataSource&lt;T&gt;</td>
    </tr>
    

</table>




<table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="12" style="border:none;margin:0;padding:0;">

  <a href="#" onclick="return toggleInherited(this, null)" id="subclasses-direct" class="jd-expando-trigger closed"
          ><img id="subclasses-direct-trigger"
          src="../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>Known Direct Subclasses

  <div id="subclasses-direct">
      <div id="subclasses-direct-list"
              class="jd-inheritedlinks"
              
              >
          
            
              <a href="../../../com/facebook/imagepipeline/datasource/ListDataSource.html">ListDataSource</a>&lt;T&gt;,
            
              <a href="../../../com/facebook/imagepipeline/datasource/SettableDataSource.html">SettableDataSource</a>&lt;T&gt;
            
          
      </div>
      <div id="subclasses-direct-summary"
              style="display: none;"
              >
  <table class="jd-sumtable-expando">
        <tr class="alt-color api apilevel-" >
              <td class="jd-linkcol"><a href="../../../com/facebook/imagepipeline/datasource/ListDataSource.html">ListDataSource</a>&lt;T&gt;</td>
              <td class="jd-descrcol" width="100%">Data source that wraps number of other data sources and waits until all of them are finished.&nbsp;</td>
          </tr>
        <tr class=" api apilevel-" >
              <td class="jd-linkcol"><a href="../../../com/facebook/imagepipeline/datasource/SettableDataSource.html">SettableDataSource</a>&lt;T&gt;</td>
              <td class="jd-descrcol" width="100%">A <code><a href="../../../com/facebook/datasource/DataSource.html">DataSource</a></code> whose result may be set by a #set(CloseableReference<T>) or
 <code><a href="../../../com/facebook/imagepipeline/datasource/SettableDataSource.html#setException(java.lang.Throwable)">setException(Throwable)</a></code> call.&nbsp;</td>
          </tr>
  </table>
      </div>
  </div>
</td></tr></table>




<div class="jd-descr">


<h2>Class Overview</h2>
<p>An abstract implementation of <code><a href="../../../com/facebook/datasource/DataSource.html">DataSource</a></code> interface.

 <p> It is highly recommended that other data sources extend this class as it takes care of the
 state, as well as of notifying listeners when the state changes.

 <p> Subclasses should override <code><a href="../../../com/facebook/datasource/AbstractDataSource.html#closeResult(T)">closeResult(T)</a></code> if results need clean up</p>





</div><!-- jd-descr -->
















<div class="jd-descr">


<h2>Summary</h2>

























<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<table id="proctors" class="jd-sumtable"><tr><th colspan="12">Protected Constructors</th></tr>



	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#AbstractDataSource()">AbstractDataSource</a></span>()
        
  </td></tr>



</table>




<!-- ========== METHOD SUMMARY =========== -->
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>



	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#close()">close</a></span>()
        
        <div class="jd-descrdiv">Cancels the ongoing request and releases all associated resources.</div>
  
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            Throwable
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#getFailureCause()">getFailureCause</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            float
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#getProgress()">getProgress</a></span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            T
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#getResult()">getResult</a></span>()
        
        <div class="jd-descrdiv">The most recent result of the asynchronous computation.</div>
  
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#hasFailed()">hasFailed</a></span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#hasResult()">hasResult</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#isClosed()">isClosed</a></span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            synchronized
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#isFinished()">isFinished</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#subscribe(com.facebook.datasource.DataSubscriber<T>, java.util.concurrent.Executor)">subscribe</a></span>(<a href="../../../com/facebook/datasource/DataSubscriber.html">DataSubscriber</a>&lt;T&gt; dataSubscriber, Executor executor)
        
        <div class="jd-descrdiv">Subscribe for notifications whenever the state of the DataSource changes.</div>
  
  </td></tr>



</table>




<!-- ========== METHOD SUMMARY =========== -->
<table id="promethods" class="jd-sumtable"><tr><th colspan="12">Protected Methods</th></tr>



	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#closeResult(T)">closeResult</a></span>(T result)
        
        <div class="jd-descrdiv">Subclasses should override this method to close the result that is not needed anymore.</div>
  
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#notifyProgressUpdate()">notifyProgressUpdate</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#setFailure(java.lang.Throwable)">setFailure</a></span>(Throwable throwable)
        
        <div class="jd-descrdiv">Subclasses should invoke this method to set the failure.</div>
  
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#setProgress(float)">setProgress</a></span>(float progress)
        
        <div class="jd-descrdiv">Subclasses should invoke this method to set the progress.</div>
  
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/AbstractDataSource.html#setResult(T, boolean)">setResult</a></span>(T value, boolean isLast)
        
        <div class="jd-descrdiv">Subclasses should invoke this method to set the result to <code>value</code>.</div>
  
  </td></tr>



</table>





<!-- ========== METHOD SUMMARY =========== -->
<table id="inhmethods" class="jd-sumtable"><tr><th>
  <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
  <div style="clear:left;">Inherited Methods</div></th></tr>


<tr class="api apilevel-" >
<td colspan="12">
  <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
          ><img id="inherited-methods-java.lang.Object-trigger"
          src="../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>
From class

  java.lang.Object

<div id="inherited-methods-java.lang.Object">
  <div id="inherited-methods-java.lang.Object-list"
        class="jd-inheritedlinks">
  </div>
  <div id="inherited-methods-java.lang.Object-summary" style="display: none;">
    <table class="jd-sumtable-expando">
    


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            Object
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">clone</span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">equals</span>(Object arg0)
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">finalize</span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            final
            
            
            Class&lt;?&gt;
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">getClass</span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            int
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">hashCode</span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">notify</span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">notifyAll</span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            
            
            
            String
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">toString</span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">wait</span>(long arg0, int arg1)
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">wait</span>(long arg0)
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">wait</span>()
        
  </td></tr>


</table>
  </div>
</div>
</td></tr>



<tr class="api apilevel-" >
<td colspan="12">
  <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.facebook.datasource.DataSource" class="jd-expando-trigger closed"
          ><img id="inherited-methods-com.facebook.datasource.DataSource-trigger"
          src="../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>
From interface

  <a href="../../../com/facebook/datasource/DataSource.html">com.facebook.datasource.DataSource</a>

<div id="inherited-methods-com.facebook.datasource.DataSource">
  <div id="inherited-methods-com.facebook.datasource.DataSource-list"
        class="jd-inheritedlinks">
  </div>
  <div id="inherited-methods-com.facebook.datasource.DataSource-summary" style="display: none;">
    <table class="jd-sumtable-expando">
    


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#close()">close</a></span>()
        
        <div class="jd-descrdiv">Cancels the ongoing request and releases all associated resources.</div>
  
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            Throwable
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#getFailureCause()">getFailureCause</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            float
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#getProgress()">getProgress</a></span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            T
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#getResult()">getResult</a></span>()
        
        <div class="jd-descrdiv">The most recent result of the asynchronous computation.</div>
  
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#hasFailed()">hasFailed</a></span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#hasResult()">hasResult</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#isClosed()">isClosed</a></span>()
        
  </td></tr>


	 
    <tr class=" api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#isFinished()">isFinished</a></span>()
        
  </td></tr>


	 
    <tr class="alt-color api apilevel-" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="../../../com/facebook/datasource/DataSource.html#subscribe(com.facebook.datasource.DataSubscriber<T>, java.util.concurrent.Executor)">subscribe</a></span>(<a href="../../../com/facebook/datasource/DataSubscriber.html">DataSubscriber</a>&lt;T&gt; dataSubscriber, Executor executor)
        
        <div class="jd-descrdiv">Subscribe for notifications whenever the state of the DataSource changes.</div>
  
  </td></tr>


</table>
  </div>
</div>
</td></tr>


</table>


</div><!-- jd-descr (summary) -->

<!-- Details -->








<!-- XML Attributes -->


<!-- Enum Values -->


<!-- Constants -->


<!-- Fields -->


<!-- Public ctors -->



<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- Protected ctors -->

<h2>Protected Constructors</h2>



<a id="AbstractDataSource()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        protected 
         
         
         
         
        
      </span>
      <span class="sympad">AbstractDataSource</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>





<!-- ========= METHOD DETAIL ======== -->
<!-- Public methdos -->

<h2>Public Methods</h2>



<a id="close()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        boolean
      </span>
      <span class="sympad">close</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Cancels the ongoing request and releases all associated resources.

 <p>Subsequent calls to <code><a href="../../../com/facebook/datasource/DataSource.html#getResult()">getResult()</a></code> will return null.</p></div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Returns</h5>
      <ul class="nolist"><li>true if the data source is closed for the first time
</li></ul>
  </div>

    </div>
</div>


<a id="getFailureCause()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        Throwable
      </span>
      <span class="sympad">getFailureCause</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="getProgress()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        float
      </span>
      <span class="sympad">getProgress</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="getResult()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        T
      </span>
      <span class="sympad">getResult</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>The most recent result of the asynchronous computation.

 <p>The caller gains ownership of the object and is responsible for releasing it.
 Note that subsequent calls to getResult might give different results. Later results should be
 considered to be of higher quality.

 <p>This method will return null in the following cases:
 <ul>
 <li>when the DataSource does not have a result (<code>hasResult</code> returns false).
 <li>when the last result produced was null.
 </ul></p></div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Returns</h5>
      <ul class="nolist"><li>current best result
</li></ul>
  </div>

    </div>
</div>


<a id="hasFailed()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        boolean
      </span>
      <span class="sympad">hasFailed</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="hasResult()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        boolean
      </span>
      <span class="sympad">hasResult</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="isClosed()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        boolean
      </span>
      <span class="sympad">isClosed</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="isFinished()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
        synchronized 
        boolean
      </span>
      <span class="sympad">isFinished</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="subscribe(com.facebook.datasource.DataSubscriber<T>, java.util.concurrent.Executor)"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        void
      </span>
      <span class="sympad">subscribe</span>
      <span class="normal">(<a href="../../../com/facebook/datasource/DataSubscriber.html">DataSubscriber</a>&lt;T&gt; dataSubscriber, Executor executor)</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Subscribe for notifications whenever the state of the DataSource changes.

 <p>All changes will be observed on the provided executor.</p></div>

    </div>
</div>





<!-- ========= METHOD DETAIL ======== -->

<h2>Protected Methods</h2>



<a id="closeResult(T)"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        protected 
         
         
         
         
        void
      </span>
      <span class="sympad">closeResult</span>
      <span class="normal">(T result)</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Subclasses should override this method to close the result that is not needed anymore.

 <p> This method is called in two cases:
 1. to clear the result when data source gets closed
 2. to clear the previous result when a new result is set
</p></div>

    </div>
</div>


<a id="notifyProgressUpdate()"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        protected 
         
         
         
         
        void
      </span>
      <span class="sympad">notifyProgressUpdate</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>


<a id="setFailure(java.lang.Throwable)"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        protected 
         
         
         
         
        boolean
      </span>
      <span class="sympad">setFailure</span>
      <span class="normal">(Throwable throwable)</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Subclasses should invoke this method to set the failure.

 <p> This method will return <code>true</code> if the failure was successfully set, or
 <code>false</code> if the data source has already been set, failed or closed.

 <p> If the failure was successfully set, state of the data source will be set to
 AbstractDataSource.DataSourceStatus#FAILURE.

 <p> This will also notify the subscribers if the failure was successfully set.

 <p> Do NOT call this method from a synchronized block as it invokes external code of the
 subscribers.</p></div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Parameters</h5>
      <table class="jd-tagtable">
        <tr>
          <th>throwable</th>
          <td>the failure cause to be set.</td>
        </tr>
      </table>
  </div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Returns</h5>
      <ul class="nolist"><li>true if the failure was successfully set.
</li></ul>
  </div>

    </div>
</div>


<a id="setProgress(float)"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        protected 
         
         
         
         
        boolean
      </span>
      <span class="sympad">setProgress</span>
      <span class="normal">(float progress)</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Subclasses should invoke this method to set the progress.

 <p> This method will return <code>true</code> if the progress was successfully set, or
 <code>false</code> if the data source has already been set, failed or closed.

 <p> This will also notify the subscribers if the progress was successfully set.

 <p> Do NOT call this method from a synchronized block as it invokes external code of the
 subscribers.</p></div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Parameters</h5>
      <table class="jd-tagtable">
        <tr>
          <th>progress</th>
          <td>the progress in range [0, 1] to be set.</td>
        </tr>
      </table>
  </div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Returns</h5>
      <ul class="nolist"><li>true if the progress was successfully set.
</li></ul>
  </div>

    </div>
</div>


<a id="setResult(T, boolean)"></a>

<div class="jd-details api apilevel-"> 
    <h4 class="jd-details-title">
      <span class="normal">
        protected 
         
         
         
         
        boolean
      </span>
      <span class="sympad">setResult</span>
      <span class="normal">(T value, boolean isLast)</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Subclasses should invoke this method to set the result to <code>value</code>.

 <p> This method will return <code>true</code> if the value was successfully set, or
 <code>false</code> if the data source has already been set, failed or closed.

 <p> If the value was successfully set and <code>isLast</code> is <code>true</code>, state of the
 data source will be set to AbstractDataSource.DataSourceStatus#SUCCESS.

 <p> <code><a href="../../../com/facebook/datasource/AbstractDataSource.html#closeResult(T)">closeResult(T)</a></code> will be called for the previous result if the new value was
 successfully set, OR for the new result otherwise.

 <p> This will also notify the subscribers if the value was successfully set.

 <p> Do NOT call this method from a synchronized block as it invokes external code of the
 subscribers.</p></div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Parameters</h5>
      <table class="jd-tagtable">
        <tr>
          <th>value</th>
          <td>the value that was the result of the task.</td>
        </tr>
        <tr>
          <th>isLast</th>
          <td>whether or not the value is last.</td>
        </tr>
      </table>
  </div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Returns</h5>
      <ul class="nolist"><li>true if the value was successfully set.
</li></ul>
  </div>

    </div>
</div>





<!-- ========= END OF CLASS DATA ========= -->
<a id="navbar_top"></a>

<div id="footer">
Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>.
</div> <!-- end footer -->

</div> <!-- jd-content -->

</div><!-- end doc-content -->

</div> <!-- end body-content --> 

<script type="text/javascript">
init(); /* initialize doclava-developer-docs.js */
</script>

</body>
</html>
